home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / masm.arc / ASSEMBLE.MAC < prev    next >
Text File  |  1985-03-06  |  36KB  |  563 lines

  1. type assemb.mac
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;;                                                                           ;;
  4. ;;                               ASSEMBLE.MAC                                ;;
  5. ;;                                                                           ;;
  6. ;;            Sample macro library for the IBM PC Macro Assembler            ;;
  7. ;;                                                                           ;;
  8. ;;                            (C) Copyright 1983                             ;;
  9. ;;                                    by                                     ;;
  10. ;;                             Jerry D. Stuckle                              ;;
  11. ;;                                                                           ;;
  12. ;;                         Released to Public Domain                         ;;
  13. ;;                                                                           ;;
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  15. Clear   Macro   R1,R2,R3,R4,R5,R6,R7,R8
  16. ;;***************************************************************************;;
  17. ;;                                                                           ;;
  18. ;; Macro: Clear                                                              ;;
  19. ;;                                                                           ;;
  20. ;; Description: Clear registers                                              ;;
  21. ;;                                                                           ;;
  22. ;; Paramaters: Up to 8 registers to be cleared                               ;;
  23. ;;                                                                           ;;
  24. ;; Input: N/A                                                                ;;
  25. ;;                                                                           ;;
  26. ;; Output: Requested registers set to binary 0's                             ;;
  27. ;;                                                                           ;;
  28. ;; Registers Used: None                                                      ;;
  29. ;;                                                                           ;;
  30. ;;***************************************************************************;;
  31.         Irp     Rx,<R1,R2,R3,R4,R5,R6,R7,R8>    ;Register list
  32.         Ifnb    <Rx>                            ;For each register in list
  33.         Xor     Rx,Rx                           ;Clear the register
  34.         Endif                                   ;End of Ifidn
  35.         Endm                                    ;End of Irp
  36.         Endm                                    ;Macro end
  37. Cls     Macro
  38.         Local   Cls1,Clsd
  39. ;;***************************************************************************;;
  40. ;;                                                                           ;;
  41. ;; Macro: Cls                                                                ;;
  42. ;;                                                                           ;;
  43. ;; Description: Clear the display screen                                     ;;
  44. ;;                                                                           ;;
  45. ;; Paramaters: None                                                          ;;
  46. ;;                                                                           ;;
  47. ;; Input: None                                                               ;;
  48. ;;                                                                           ;;
  49. ;; Output: None                                                              ;;
  50. ;;                                                                           ;;
  51. ;; Registers Used: AX,DX                                                     ;;
  52. ;;                                                                           ;;
  53. ;;***************************************************************************;;
  54.         Display Clsd                            ;Display the Dos2 String
  55.         Jmp     Short Cls1                      ;Go around the string data
  56. Clsd    Db      1bh,'[2J$'                      ;Data for Dos Call
  57. Cls1    Label   Near
  58.         Endm
  59. Color   Macro   Foreground,Background
  60.         Local   Cold,Col1
  61. ;;***************************************************************************;;
  62. ;;                                                                           ;;
  63. ;; Macro: Color                                                              ;;
  64. ;;                                                                           ;;
  65. ;; Description: Sets display color                                           ;;
  66. ;;                                                                           ;;
  67. ;; Paramaters: Foreground Color, Background Color                            ;;
  68. ;;                                                                           ;;
  69. ;; Input: None                                                               ;;
  70. ;;                                                                           ;;
  71. ;; Output: None                                                              ;;
  72. ;;                                                                           ;;
  73. ;; Registers Used: AX,DX                                                     ;;
  74. ;;                                                                           ;;
  75. ;;***************************************************************************;;
  76.         Display Cold                            ;Display the color string
  77.         Jmp     Short Col1                      ;Go around the string
  78. Cold    Db      1bh,'['                         ;Start of string
  79.         Ifidn   <Foreground>,<Normal>           ;If normal request
  80.         Db      '0'                             ;Normal Foreground
  81.         Else
  82.         Ifidn   <Foreground>,<Bold>             ;If Bold Request
  83.         Db      '1'                            ;Bold Foreground
  84.         Else
  85.         Ifidn   <Foreground>,<Underscore>       ;If Underscored
  86.         Db      '4'                             ;Underscore Foreground
  87.         Else
  88.         Ifidn   <Foreground>,<Blink>            ;If Blink request
  89.         Db      '5'                             ;Blink Foreground
  90.         Else
  91.         Ifidn   <Foreground>,<Reverse>          ;If Reverse request
  92.         Db      '7'                             ;Reverse Video
  93.         Else
  94.         Ifidn   <Foreground>,<Invisible>        ;If Invisable Request
  95.         Db      '8'                             ;Invisable (No-Show)
  96.         Else
  97.         Ifidn   <Foreground>,<Black>            ;If Black Request
  98.         Db      '30'                            ;Black Foreground
  99.         Else
  100.         Ifidn   <Foreground>,<Red>              ;If Red Request
  101.         Db      '31'                            ;Red Foreground
  102.         Else
  103.         Ifidn   <Foreground>,<Green>            ;If Green Request
  104.         Db      '32'                            ;Green Foreground
  105.         Else
  106.         Ifidn   <Foreground>,<Yellow>           ;If Yellow Request
  107.         Db      '33'                            ;Yellow Foreground
  108.         Else
  109.         Ifidn   <Foreground>,<Blue>             ;If Blue Request
  110.         Db      '34'                            ;Blue Foreground
  111.         Else
  112.         Ifidn   <Foreground>,<Magenta>          ;If Magenta Request
  113.         Db      '35'                            ;Magenta Foreground
  114.         Else
  115.         Ifidn   <Foreground>,<Cyan>             ;If Cyan Request
  116.         Db      '36'                            ;Cyan Foreground
  117.         Else
  118.         Ifidn   <Foreground>,<White>            ;If White Request
  119.         Db      '37'                            ;White Foreground
  120.         Endif
  121.         Endif
  122.         Endif
  123.         Endif
  124.         Endif
  125.         Endif
  126.         Endif
  127.         Endif
  128.         Endif
  129.         Endif
  130.         Endif
  131.         Endif
  132.         Endif
  133.         Endif
  134.         Ifnb    <Foreground>                    ;If we have foreground...
  135.         Ifnb    <Background>                    ;And background colors
  136.         Db      ';'                             ;Put in a Seperator
  137.         Endif
  138.         Endif
  139.         Ifidn   <Background>,<Black>            ;If Black Request
  140.         Db      '40'                            ;Black Background
  141.         Else
  142.         Ifidn   <Background>,<Red>              ;If Red Request
  143.         Db      '41'                            ;Red Background
  144.         Else
  145.         Ifidn   <Background>,<Green>            ;If Green Request
  146.         Db      '42'                            ;Green Background
  147.         Else
  148.         Ifidn   <Background>,<Yellow>           ;If Yellow Request
  149.         Db      '43'                            ;Yellow Background
  150.         Else
  151.         Ifidn   <Background>,<Blue>             ;If Blue Request
  152.         Db      '44'                            ;Blue Background
  153.         Else
  154.         Ifidn   <Background>,<Magenta>          ;If Magenta Request
  155.         Db      '45'                            ;Magenta Background
  156.         Else
  157.         Ifidn   <Background>,<Cyan>             ;If Cyan Request
  158.         Db      '46'                            ;Cyan Background
  159.         Else
  160.         Ifidn   <Background>,<White>            ;If White Request
  161.         Db      '47'                            ;White Background
  162.         Endif
  163.         Endif
  164.         Endif
  165.         Endif
  166.         Endif
  167.         Endif
  168.         Endif
  169.         Endif
  170. Col1    Label   Near                            ;Skip around data
  171.         Endm
  172. Cursor  Macro   Function,Area
  173. ;;***************************************************************************;;
  174. ;;                                                                           ;;
  175. ;; Macro: Cursor                                                             ;;
  176. ;;                                                                           ;;
  177. ;; Description: Save or set current cursor type, blank cursor on screen      ;;
  178. ;;                                                                           ;;
  179. ;; Paramaters: Function (Save,Set or Erase), Data or Data address            ;;
  180. ;;                                                                           ;;
  181. ;; Input: Cursor start and end lines (Set only)                              ;;
  182. ;;                                                                           ;;
  183. ;; Output: Cursor start and end lines (Save only)                            ;;
  184. ;;                                                                           ;;
  185. ;; Registers Used: AX,CX  (DS used and restored)                             ;;
  186. ;;                                                                           ;;
  187. ;;***************************************************************************;;
  188.         Ifidn   <Function>,<Erase>              ;If cursor erase requested
  189.         Mov     AH,1                            ;Set cursor mode
  190.         Mov     CX,0F0FH                        ;Start and end on line 15
  191.         Int     10h                             ;Go do a video interrupt
  192.         Else
  193.         Ifidn   <Function>,<Save>               ;If cursor save request
  194.         Push    DS                              ;Save DS
  195.         Mov     AX,40h                          ;Get segment 40h in AX
  196.         Mov     DS,AX                           ;And put it in DS
  197.         Mov     CX,DS:60h                       ;Get current cursor mode
  198.         Pop     DS                              ;Restore DS
  199.         Mov     Area,CX                         ;And move cursor mode to Area
  200.         Else
  201.         Ifidn   <Function>,<Set>                ;If cursor set request
  202.         Mov     CX,Area                         ;Get cursor mode in CX
  203.         Mov     AH,1                            ;Set cursor mode
  204.         Int     10h                             ;Go do video interrupt
  205.         Endif
  206.         Endif
  207.         Endif
  208.         Endm
  209. Cvd     Macro   Dest,Org
  210.         Local   Cvbp,Cvde
  211. ;;***************************************************************************;;
  212. ;;                                                                           ;;
  213. ;; Macro: Cvd                                                                ;;
  214. ;;                                                                           ;;
  215. ;; Description: Convert binary number to  Ascii decimal number               ;;
  216. ;;                                                                           ;;
  217. ;; Paramaters: Output Label, Input Label                                     ;;
  218. ;;                                                                           ;;
  219. ;; Input: Word binary number                                                 ;;
  220. ;;                                                                           ;;
  221. ;; Output: 4 Byte decimal number                                             ;;
  222. ;;                                                                           ;;
  223. ;; Registers Used: AX,BX,DX,DI                                               ;;
  224. ;;                                                                           ;;
  225. ;;***************************************************************************;;
  226.         Ifdif   <Org>,<AX>                      ;If binary value not in AX
  227.         Mov     AX,Word ptr Org                 ;Move origin to AX
  228.         Endif
  229.         Lea     DI,Dest                         ;Get address of destination
  230.         Mov     BL,100d                         ;Divisor to BL
  231.         Div     BL                              ;Divide by 100
  232.         Mov     BH,AH                           ;Save remainder in BH
  233.         Call    Cvdp                            ;Convert highorder  to decimal
  234.         Mov     AL,BH                           ;Get remainder
  235.         Call    Cvdp                            ;Convert low order to decimal
  236.         Jmp     Short Cvde                      ;Jump around proc
  237. Cvdp    Proc    Near
  238.         Aam                                     ;Convert to packed decimal
  239.         Or      AX,3030h                        ;Convert to Ascii
  240.         Mov     [DI],AH                         ;Store high order byte
  241.         Inc     DI                              ;Point to next byte
  242.         Mov     [DI],AL                         ;Store low order byte
  243.         Inc     DI                              ;Point to next byte
  244.         Ret                                     ;Return to caller
  245. Cvdp    Endp
  246. Cvde    Label   Near
  247.         Endm
  248. Display Macro   String
  249. ;;***************************************************************************;;
  250. ;;                                                                           ;;
  251. ;; Macro: Display                                                            ;;
  252. ;;                                                                           ;;
  253. ;; Description: Print an ascii string on the screen                          ;;
  254. ;;                                                                           ;;
  255. ;; Paramaters: Label of string to be printed                                 ;;
  256. ;;                                                                           ;;
  257. ;; Input: Ascii string, ending with a $                                      ;;
  258. ;;                                                                           ;;
  259. ;; Output: None                                                              ;;
  260. ;;                                                                           ;;
  261. ;; Registers Used: AX,DX                                                     ;;
  262. ;;                                                                           ;;
  263. ;;***************************************************************************;;
  264.         Lea     DX,String                       ;Address of string to display
  265.         Doscall 9                               ;Dos Print string function
  266.         Endm
  267. Doscall Macro   Function
  268. ;;***************************************************************************;;
  269. ;;                                                                           ;;
  270. ;; Macro: Doscall                                                            ;;
  271. ;;                                                                           ;;
  272. ;; Description:  Set up and execute requested DOS function call              ;;
  273. ;;                                                                           ;;
  274. ;; Paramaters: Function to be called                                         ;;
  275. ;;                                                                           ;;
  276. ;; Input: None                                                               ;;
  277. ;;                                                                           ;;
  278. ;; Output: None                                                              ;;
  279. ;;                                                                           ;;
  280. ;; Registers Used: AX                                                        ;;
  281. ;;                                                                           ;;
  282. ;;***************************************************************************;;
  283.         Mov     AH,Function                     ;Get function in AH
  284.         Int     21h                             ;Dos Call
  285.         Endm
  286. Getdate Macro   Dest,Type
  287.         Local   Gdte,Gtdp
  288. ;;***************************************************************************;;
  289. ;;                                                                           ;;
  290. ;; Macro: Getdate                                                            ;;
  291. ;;                                                                           ;;
  292. ;; Description: Gets current date into destination                           ;;
  293. ;;                                                                           ;;
  294. ;; Paramaters: Destination, Type of date (Char or Bin)                       ;;
  295. ;;                                                                           ;;
  296. ;; Input: None                                                               ;;
  297. ;;                                                                           ;;
  298. ;; Output: MM/DD/YY (Char) or MDYY (Bin)                                     ;;
  299. ;;                                                                           ;;
  300. ;; Registers Used: AX,BX,CX,DX,DI                                            ;;
  301. ;;                                                                           ;;
  302. ;;***************************************************************************;;
  303.         Ifidn   <Type>,<Char>                   ;If character request
  304.         Doscall 2Ah                             ;Get date function call
  305.         Lea     DI,Dest                         ;Get address of destination
  306.         Mov     AL,DH                           ;Get month in AL
  307.         Call    Gdtp                            ;Convert byte to ascii
  308.         Mov     Word ptr [DI],'/'               ;Move in /
  309.         Inc     DI                              ;Point to next byte
  310.         Mov     AL,DL                           ;Get day in AL
  311.         Call    Gdtp                            ;Convert byte to ascii
  312.         Mov     Word ptr [DI],'/'               ;Move in /
  313.         Inc     DI                              ;Point to next byte
  314.         Mov     AX,CX                           ;Get year in AL
  315.         Mov     BL,100d                         ;Move in divisor
  316.         Div     BL                              ;Divide by 100
  317.         Mov     AL,AH                           ;Remainder to AL
  318.         Call    Gdtp                            ;Convert byte to Ascii
  319.         Jmp     Short Gdte                      ;Jump around proc
  320. Gdtp    Proc    Near
  321.         AAM                                     ;Convert to packed decimal
  322.         Add     AX,3030h                        ;Convert to ASCII
  323.         Mov     Byte ptr [DI],AH                ;Store high order byte
  324.         Inc     DI                              ;Point to next byte
  325.         Mov     Byte Ptr [DI],AL                ;Store low order byte
  326.         Inc     DI                              ;Point to next byte
  327.         Ret                                     ;Return to caller
  328. Gdtp    Endp
  329. Gdte    Label   Near
  330.         Else
  331.         Ifidn   <Type>,<Bin>                    ;If Binary request
  332.         Doscall 2Ah                             ;Get current date
  333.         Mov     Byte ptr Dest,DH                ;Move month to destination
  334.         Mov     Byte ptr [Dest+1],DL            ;Move dat to destination
  335.         Mov     Word ptr [Dest+2],CX            ;Move year to destination
  336.         Endif
  337.         Endif
  338.         Endm
  339. Gettime Macro   Dest,Type
  340.         Local   Gtmp,Gtme
  341. ;;***************************************************************************;;
  342. ;;                                                                           ;;
  343. ;; Macro: Gettime                                                            ;;
  344. ;;                                                                           ;;
  345. ;; Description: Get current time into Destination                            ;;
  346. ;;                                                                           ;;
  347. ;; Paramaters: Destination, Type (Char or Bin)                               ;;
  348. ;;                                                                           ;;
  349. ;; Input: None                                                               ;;
  350. ;;                                                                           ;;
  351. ;; Output: HH:MM:SS:HH (Char) or HMSH (Bin)                                  ;;
  352. ;;                                                                           ;;
  353. ;; Registers Used: AX,BX,CX,DX,DI                                            ;;
  354. ;;                                                                           ;;
  355. ;;***************************************************************************;;
  356.         Ifidn   <Type>,<Char>                   ;If character request
  357.         Doscall 2Ch                             ;Get current time
  358.         Lea     DI,Dest                         ;Get destination address
  359.         Mov     AL,CH                           ;Move hours to AL
  360.         Call    Gtmp                            ;And convert to ASCII
  361.         Mov     Word ptr [DI],':'               ;Put in :
  362.         Inc     DI                              ;Point to next byte
  363.         Mov     AL,CL                           ;Move minutes to AL
  364.         Call    Gtmp                            ;And convert to ASCII
  365.         Mov     Word ptr [DI],':'               ;Put in :
  366.         Inc     DI                              ;Point to next byte
  367.         Mov     AL,DH                           ;Move seconds to AL
  368.         Call    Gtmp                            ;And convert to ASCII
  369.         Mov     Word ptr [DI],':'               ;Put in :
  370.         Inc     DI                              ;Point to next byte
  371.         Mov     AL,DL                           ;Move hundreths to AL
  372.         Call    Gtmp                            ;And convert to ASCII
  373.         Jmp     Short Gtme                      ;Jump around proc
  374. Gtmp    Proc    Near
  375.         AAM                                     ;Convert to packed decimal
  376.         Add     AX,3030h                        ;Convert to ASCII
  377.         Mov     Byte ptr [DI],AH                ;Store high order byte
  378.         Inc     DI                              ;Point to next byte
  379.         Mov     Byte Ptr [DI],AL                ;Store low order byte
  380.         Inc     DI                              ;Point to next byte
  381.         Ret                                     ;Return to caller
  382. Gtmp    Endp
  383. Gtme    Label   Near
  384.         Else
  385.         Ifidn   <Type>,<Bin>                    ;If request for Binary time
  386.         Doscall 2Ch                             ;Get current time
  387.         Mov     Byte ptr Dest,CH                ;Move hours to destination
  388.         Mov     Byte ptr Dest+1,CL              ;Move minutes to destination
  389.         Mov     Byte ptr Dest+2,DH              ;Move seconds to destination
  390.         Mov     Byte ptr Dest+3,DL              ;Move hundreths to destination
  391.         Endif
  392.         Endif
  393.         Endm
  394. Locate  Macro   Row,Column
  395.         Local   Loc1,Locd
  396. ;;***************************************************************************;;
  397. ;;                                                                           ;;
  398. ;; Macro: Locate                                                             ;;
  399. ;;                                                                           ;;
  400. ;; Description: Position Cursor on screen                                    ;;
  401. ;;                                                                           ;;
  402. ;; Paramaters: Row, Column                                                   ;;
  403. ;;                                                                           ;;
  404. ;; Input: Binary row and column location, if not in macro call               ;;
  405. ;;                                                                           ;;
  406. ;; Output: None                                                              ;;
  407. ;;                                                                           ;;
  408. ;; Registers Used: AX,DX                                                     ;;
  409. ;;                                                                           ;;
  410. ;;***************************************************************************;;
  411.         Mov     AL,Row                          ;Get binary row
  412.         Aam                                     ;Convert to packed decimal
  413.         Add     AX,3030h                        ;Convert to Ascii
  414.         Mov     Byte Ptr [Locd+2],AH            ;High order row to string
  415.         Mov     Byte Ptr [Locd+3],AL            ;Low order row to string
  416.         Clear   AH                              ;Clear AH again
  417.         Mov     AL,Column                       ;Get column in AL
  418.         Aam                                     ;Convert to packed decimal
  419.         Add     AX,3030h                        ;Convert to Ascii
  420.         Mov     Byte Ptr [Locd+5],AH            ;High order column to string
  421.         Mov     Byte Ptr [Locd+6],AL            ;Low order column ti string
  422.         Display Locd                            ;Position the cursor
  423.         Jmp     Short Loc1                      ;Jump around string
  424. Locd    Db      1bh,'[  ;  H$'                  ;Position cursor string
  425. Loc1    Label   Near
  426.         Endm
  427. Move    Macro   To,From,Lngth
  428.         Local   Movelp
  429. ;;***************************************************************************;;
  430. ;;                                                                           ;;
  431. ;; Macro: Move                                                               ;;
  432. ;;                                                                           ;;
  433. ;; Description: Multiple byte move                                           ;;
  434. ;;                                                                           ;;
  435. ;; Paramaters: To location, from location, Length (Opt.)                     ;;
  436. ;;                                                                           ;;
  437. ;; Input: Source string                                                      ;;
  438. ;;                                                                           ;;
  439. ;; Output: Destination string                                                ;;
  440. ;;                                                                           ;;
  441. ;; Registers Used: CX,SI,DI (ES assumed pointing to destination segment)     ;;
  442. ;;                                                                           ;;
  443. ;;***************************************************************************;;
  444.         Clear   CH                              ;Clear length reg
  445.         Ifb     <Length>                        ;If no length requested
  446.         Mov     CX,Length To                    ;Use length of to string
  447.         Else                                    ;If length requested
  448.         Mov     CX,Lngth                        ;Use length in macro
  449.         Endif
  450.         Ifdif   <To>,<DI>                       ;If DI not specified for To
  451.         Lea     DI,To                           ;Load To address into DI
  452.         Endif
  453.         Ifdif   <From>,<SI>                     ;If SI not specified for From
  454.         Lea     SI,From                         ;Load From address into SI
  455.         Endif
  456.         Cld                                     ;Clear direction flag
  457.         Rep     Movsb                           ;Move the data
  458.         Endm
  459. Restore Macro   R1,R2,R3,R4,R5,R6,R7,R8,R9,R10
  460. ;;***************************************************************************;;
  461. ;;                                                                           ;;
  462. ;; Macro: Restore                                                            ;;
  463. ;;                                                                           ;;
  464. ;; Description: Restore registers from stack                                 ;;
  465. ;;                                                                           ;;
  466. ;; Paramaters: Registers to be restored (in reverse order)                   ;;
  467. ;;                                                                           ;;
  468. ;; Input: None                                                               ;;
  469. ;;                                                                           ;;
  470. ;; Output: Restored registers                                                ;;
  471. ;;                                                                           ;;
  472. ;; Registers Used: None                                                      ;;
  473. ;;                                                                           ;;
  474. ;;***************************************************************************;;
  475.         Irp     Rx,<R10,R9,R8,R7,R6,R5,R4,R3,R2,R1> ;Repeat for each parm
  476.         Ifnb    <Rx>                            ;If this parm not blank
  477.         Pop     Rx                              ;Pop the register
  478.         Endif                                   ;End Ifnb
  479.         Endm                                    ;End Irp
  480.         Endm
  481. Save    Macro   R1,R2,R3,R4,R5,R6,R7,R8,R9,R10
  482. ;;***************************************************************************;;
  483. ;;                                                                           ;;
  484. ;; Macro: Save                                                               ;;
  485. ;;                                                                           ;;
  486. ;; Description: Save registers on the stack                                  ;;
  487. ;;                                                                           ;;
  488. ;; Paramaters: Registers to be saved                                         ;;
  489. ;;                                                                           ;;
  490. ;; Input: None                                                               ;;
  491. ;;                                                                           ;;
  492. ;; Output: Registers saved on stack                                          ;;
  493. ;;                                                                           ;;
  494. ;; Registers Used: None                                                      ;;
  495. ;;                                                                           ;;
  496. ;;***************************************************************************;;
  497.         Irp     Rx,<R1,R2,R3,R4,R5,R6,R7,R8,R9,R10> ;Repeat for each parm
  498.         Ifnb    <Rx>                            ;If this parm not blank
  499.         Push    Rx                              ;Save the register
  500.         Endif                                   ;End Ifnb
  501.         Endm                                    ;End Irp
  502.         Endm
  503. Setint  Macro   Interrupt,Routine
  504. ;;***************************************************************************;;
  505. ;;                                                                           ;;
  506. ;; Macro: Setint                                                             ;;
  507. ;;                                                                           ;;
  508. ;; Description: Set interrupt vector                                         ;;
  509. ;;                                                                           ;;
  510. ;; Paramaters: Interrupt vector, interrupt routine address                   ;;
  511. ;;                                                                           ;;
  512. ;; Input: None                                                               ;;
  513. ;;                                                                           ;;
  514. ;; Output: None                                                              ;;
  515. ;;                                                                           ;;
  516. ;; Registers Used: AX,DX                                                     ;;
  517. ;;                                                                           ;;
  518. ;;***************************************************************************;;
  519.         Mov     AL,Interrupt                    ;Get interrupt to be set
  520.         Lea     DX,Routine                      ;Get address of routine
  521.         Doscall 25h                             ;Call DOS
  522.         Endm
  523. Settime Macro   Hours,Minutes,Seconds,Hundreths
  524. ;;***************************************************************************;;
  525. ;;                                                                           ;;
  526. ;; Macro: Settime                                                            ;;
  527. ;;                                                                           ;;
  528. ;; Description: Set current time                                             ;;
  529. ;;                                                                           ;;
  530. ;; Paramaters: Hours, Minutes, Seconds,Hundreths                             ;;
  531. ;;                                                                           ;;
  532. ;; Input: Time to be set                                                     ;;
  533. ;;                                                                           ;;
  534. ;; Output: None                                                              ;;
  535. ;;                                                                           ;;
  536. ;; Registers Used: AX,CX,DX                                                  ;;
  537. ;;                                                                           ;;
  538. ;;***************************************************************************;;
  539.         Ifnb    <Hours>                         ;If hours specified
  540.         Mov     CH,Hours                        ;Move hours to CH
  541.         Else                                    ;If hours not specified
  542.         Clear   CH                              ;Clear CH
  543.         Endif
  544.         Ifnb    <Minutes>                       ;If minutes specified
  545.         Mov     CL,Minutes                      ;Move minutes to CL
  546.         Else                                    ;If minutes not specified
  547.         Clear   CL                              ;Clear CL
  548.         Endif
  549.         Ifnb    <Seconds>                       ;If seconds specified
  550.         Mov     DH,Seconds                      ;Move seconds to DH
  551.         Else                                    ;If seconds not specified
  552.         Clear   DH                              ;Clear DH
  553.         Endif
  554.         Ifnb    <Hundreths>                     ;If hundreths specified
  555.         Mov     DL,Hundreths                    ;Move hundreths to DL
  556.         Else                                    ;If hndreths not specified
  557.         Clear   DL                              ;Clear DL
  558.         Endif
  559.         Doscall 2dh                             ;Call DOS to set time
  560.         Endm
  561. XA 4:           ;Clear DL
  562.         Endif
  563.         Do